#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QtGui>
#include <QtWidgets>
#include <QtCore>
#include "newtaskwidget.h"
#include "backupprogresswidget.h"
#include "tasklistwidget.h"
#include "settingswidget.h"
#include "backupengine.h"
#include "backuptask.h"
#include "dbengine.h"

class MainWindow : public QMainWindow
{
    Q_OBJECT
    
public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();

    void createIcons();

private:
    BackupEngine *engine;
    QListWidget *contentsWidget;
    QStackedWidget *pagesWidget;

    NewTaskWidget *newTaskWidget;
    BackupProgressWidget *backupProgressWidget;
    TaskListWidget *taskListWidget;
    SettingsWidget *settingsWidget;

    QListWidgetItem *singleBackupButton;
    QListWidgetItem *backupProgressButton;
    QListWidgetItem *planingButton;
    QListWidgetItem *settingsButton;

    DBEngine *dbengine;
    QThread *backupThread;

private slots:
    void changePage(QListWidgetItem *current, QListWidgetItem *previous);
    void toggleBackupEnginePause();
    void invokeBackupEngineStop();

    void changeCurrentTab(quint8 index);
    void onBackupFinished();
};

#endif // MAINWINDOW_H
